home *** CD-ROM | disk | FTP | other *** search
/ Isometric Game Programming with DirectX 7.0 / Isometric Game Programming.iso / source / chapter13 / isohex13_5 / tileset.h < prev   
C/C++ Source or Header  |  2000-06-19  |  1KB  |  71 lines

  1. // TileSet.h: interface for the CTileSet class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_TILESET_H__793CAFA2_45E3_11D4_A1EE_B431B7F27368__INCLUDED_)
  6. #define AFX_TILESET_H__793CAFA2_45E3_11D4_A1EE_B431B7F27368__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. #include "GDICanvas.h"
  13. #include "DDFuncs.h"
  14.  
  15. //tileset information structure
  16. struct TILEINFO
  17. {
  18.     RECT rcSrc;//source rectangle
  19.     POINT ptAnchor;//anchoring point
  20.     RECT rcDstExt;//destination extent
  21. };
  22.  
  23. class CTileSet  
  24. {
  25. private:
  26.     //number of tiles in tileset
  27.     DWORD dwTileCount;
  28.  
  29.     //tile array
  30.     TILEINFO*  ptiTileList;
  31.  
  32.     //filename from which to reload
  33.     LPSTR lpszReload;
  34.  
  35.     //offscreen plain directdrawsurface7
  36.     LPDIRECTDRAWSURFACE7 lpddsTileSet;
  37.  
  38. public:
  39.     //constructor
  40.     CTileSet();
  41.  
  42.     //destructor
  43.     ~CTileSet();
  44.  
  45.     //load(initializer)
  46.     void Load(LPDIRECTDRAW7 lpdd,LPSTR lpszLoad);
  47.  
  48.     //reload(restore)
  49.     void Reload();
  50.  
  51.     //unload(uninitializer)
  52.     void Unload();
  53.  
  54.     //get number of tiles
  55.     DWORD GetTileCount();
  56.  
  57.     //get tile list
  58.     TILEINFO* GetTileList();
  59.  
  60.     //get surface
  61.     LPDIRECTDRAWSURFACE7 GetDDS();
  62.  
  63.     //retrieve filename
  64.     LPSTR GetFileName();
  65.  
  66.     //blit a tile
  67.     void PutTile(LPDIRECTDRAWSURFACE7 lpddsDst,int xDst,int yDst,int iTileNum);
  68. };
  69.  
  70. #endif // !defined(AFX_TILESET_H__793CAFA2_45E3_11D4_A1EE_B431B7F27368__INCLUDED_)
  71.